<template>
  <div class="pay-success-con">
    <div class="navbar">
      <div class="back" @click="goBack"></div>
      <div class="nav-title">支付</div>
    </div>
    <div class="head-con">
      <div class="head">
        <div class="img-con">
          <img src="../../assets/img/order/pay.png" alt="" width="50px" />
        </div>
        <div>支付成功</div>
      </div>
    </div>
    <div class="order-info">
      <div class="info">
        <div style="color: gray">订单编号:</div>
        <div>{{ order_no }}</div>
      </div>
      <div class="info">
        <div style="color: gray">下单时间:</div>
        <div>{{ time | dataFormat }}</div>
      </div>
      <div class="info">
        <div style="color: gray">支付方式:</div>
        <div>{{ payWay }}</div>
      </div>
      <div class="info">
        <div style="color: gray">订单状态:</div>
        <div>{{ orderStatus }}</div>
      </div>
    </div>
    <div class="oparate">
      <div class="see-btn" @click="seeOrder">查看订单</div>
      <div class="shop-btn" @click="toShop">继续购物</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      order_no: "12",
      time: new Date(),
      payWay: "支付宝支付",
      orderStatus: 0,
    };
  },
  created() {
    this.order_no = this.$route.query.order_no;
    if (this.$route.query.status == 1) {
      this.orderStatus = "已完成";
    } else {
      this.orderStatus = "已取消";
    }
  },
  methods: {
    goBack() {
      this.$router.push("/idssp/shopcar");
    },
    seeOrder() {
      // 查看订单
      this.$router.push("/idssp/order/myOrder");
    },
    toShop() {
      this.$router.push("/idssp/shops");
    },
  },
};
</script>
<style lang='scss' scoped>
.pay-success-con {
  padding-top: 43px; //如果不写则页面会显示不完全
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    width: 100%;
    height: 44px;
    background-color: #e25b45;
    text-align: center;
    color: white;
    font-size: 16px;
    align-items: center;
    .back {
      width: 50px;
      height: 100%;
      position: absolute;
      left: 20px;
      background: url("../../assets/img/back.png") no-repeat;
      background-size: 40% 40%;
      background-position-y: center;
    }
    .nav-title {
      margin: 0 auto;
    }
  }
  .head-con {
    margin-top: -2px;
    background-color: #e25b45;
    color: #fff;
    font-size: 14px;
    line-height: 25px;
    text-align: center;
    .head {
      padding: 30px 0;
      width: 100px;
      margin: 0 auto;
    }
  }
  .order-info {
    padding: 30px;
    .info {
      display: flex;
      justify-content: space-between;
      padding-bottom: 10px;
    }
  }
  .oparate {
    display: flex;
    margin: 30px 7px;
    .see-btn {
      border: 1px solid #fd5e01;
      background-color: #fff;
      color: #fd5e01;
      width: 96%;
      height: 34px;
      border-radius: 50px;
      text-align: center;
      line-height: 34px;
      font-size: 14px;
    }
    .shop-btn {
      background-color: #fd5e01;
      color: #fff;
      width: 96%;
      height: 34px;
      border-radius: 50px;
      text-align: center;
      line-height: 34px;
      font-size: 14px;
    }
  }
}
</style>